﻿using System.Web.Mvc;
using Framework.Admin;
using Project.Domain.Entities;

namespace Framework.BaseController
{
    public class BaseController : Controller
    {
        public User CurrentUser
        {
            get
            {
                var principal = User as EnhancedPrincipal;
                return principal == null ? null : principal.Data;
            }
        }

        public ActionResult RedirectToLogin()
        {
            return RedirectToAction("LogOn", "Account", new { returnUrl = Request.Path });
        }
    }
}